using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SMWJamecl.BusinessEntities;

namespace SMWJamecl.Repository.Mapping
{
    public class TallerMap : EntityTypeConfiguration<Taller>
    {
        public TallerMap()
        {
            // Primary Key
            this.HasKey(t => t.Id_taller);

            // Properties
            this.Property(t => t.Id_taller)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.RUC)
                .HasMaxLength(10);

            this.Property(t => t.Razon_Social)
                .HasMaxLength(200);

            this.Property(t => t.Telefono)
                .HasMaxLength(10);

            this.Property(t => t.Direccion)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Taller");
            this.Property(t => t.Id_taller).HasColumnName("Id_taller");
            this.Property(t => t.RUC).HasColumnName("RUC");
            this.Property(t => t.Razon_Social).HasColumnName("Razon_Social");
            this.Property(t => t.Telefono).HasColumnName("Telefono");
            this.Property(t => t.Direccion).HasColumnName("Direccion");
        }
    }
}
